//StrCompare v1.0
//By DreamVB

#include <iostream>
using namespace std;
using std::cout;
using std::endl;

bool StrCompare(const char *src, const char *match, bool ignorecase = false){
	bool IsSame = true;

	if (ignorecase){
		//Compare the length
		if (strlen(src) != strlen(match)){
			IsSame = false;
		}
		else{
			//Convert to lowercase and compare
			for (int i = 0; i < strlen(src); i++){
				//Compare lowercase
				if (tolower(src[i]) != tolower(match[i])){
					IsSame = false;
					break;
				}
			}
		}
		return IsSame;
	}
	else{
		return strcmp(src, match) == 0;
	}
}


int main(int argc, char *argv[]){
	string s0 = "Hello";
	string s1 = "HELLO";

	cout << "Binary Compare" << endl;
	cout << "Hello = HELLO " << StrCompare(s0.c_str(), s1.c_str()) << endl << endl;
	cout << "Text Compare case is ignored" << endl;
	cout << "Hello = HELLO " << StrCompare(s0.c_str(), s1.c_str(),true) << endl;
	cout << endl;

	system("pause");
	return 0;
}